<template>
  <view class="booking_div_bar">
    <view class="price-data">
      <view>
        <view style="display:flex;height:42rpx;align-items: flex-end;">
          <view class="price-data-title">报名费用</view>
          <view class="price-data-content">
            <span class="price-icon">￥</span>
            <span  class="price-number">{{ props.option.applyPrice }}</span>
          </view>
        </view>
        <view style="display:flex;height:42rpx;align-items: flex-end;" v-if="props.option.feeConfigType">
          <view class="price-data-title">拉新已减免</view>
          <view class="price-data-content">
            <span class="price-icon">￥{{ props.option.deductionAmount }}</span>
          </view>
        </view>
      </view>
      <view class="booking" @click="createOrder()">{{props.btnTetx}}</view>
    </view>
  </view>
</template>

<script setup>
const props = defineProps({
  option: {
    type: Object,
    default: () => {}
  },
  btnTetx: {
    type: String,
    default: '立即报名'
  }
})
const emit = defineEmits(['operate'])
const createOrder = () => {
  emit('operate')
}
</script>

<style scoped lang="scss">
@import "@/assets/styles/minx.scss";
.booking_div_bar {
  position: fixed;
  bottom: 0;
  height: calc(56px + env(safe-area-inset-bottom));
  min-height: 70px;
  width: 100%;
  background-color: #ffffff;
  left: 0;
  padding: 14px 14px 0 14px;
  z-index: 98;

  .booking {
    width: 360rpx;
    float: right;
    height: 80rpx;
    background: #F0831E;
    border-radius: 1000px;
    font-size: 32rpx;
    font-weight: 500;
    color: #ffffff;
    line-height: 78rpx;
    position: relative;
    &::before{
      @include border(full, #414141, 1000px)
    }
  }
  .price-data {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
  }
  .price-data-title {
    font-size: 22rpx;
    color: #666;
  }
  .price-data-content {
   margin: 0 8rpx;
    font-size: 40rpx;
    font-weight: 500;
    color: #ee751e;
    align-items: flex-end;
    display: flex;
    .price-icon{
      font-size: 28rpx;
      line-height: 30rpx;
    }
    .price-number{
      font-size: 40rpx;
      line-height: 42rpx;
    }
  }
}
</style>
